﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using HigLabo.Net.Extensions;
using Newtonsoft.Json.Linq;

namespace HigLabo.Net.Twitter
{
    /// <summary>
    /// 
    /// </summary>
    public class BannerInfo : ResponseObject
    {
        /// <summary>
        /// 
        /// </summary>
        public Size Ipad { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Size MobileRetina { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Size Mobile { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Size WebRetina { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Size IpadRetina { set; get; }
        /// <summary>
        /// 
        /// </summary>
        public Size Web { set; get; }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public BannerInfo(String jsonText)
        {
            this.SetProperty(jsonText);
        }
        /// <summary>
        /// 
        /// </summary>
        /// <param name="jsonText"></param>
        public override void SetProperty(string jsonText)
        {
            var d = this.SetData(jsonText);

            String sizes = d.ToString("sizes");
            d = this.SetData(sizes);

            this.Ipad = new Size(d.ToString("ipad"));
            this.MobileRetina = new Size(d.ToString("mobile_retina"));
            this.Mobile = new Size(d.ToString("mobile"));
            this.WebRetina = new Size(d.ToString("web_retina"));
            this.IpadRetina = new Size(d.ToString("ipad_retina"));
            this.Web = new Size(d.ToString("web"));
        }
    }
}
